package com.itqf.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/10/9
 * @Time: 下午4:40
 */
@Data
public class User {

    private  int id;
    @JsonProperty("username")   //json的key
    private  String name;
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")//页面展示  接收的规则
    private Date birthdate;//日期格式

    //为null不想在响应给客户端
    @JsonInclude(JsonInclude.Include.NON_NULL)//NON_EMPTY  ""  length = 0
    private List<String> hobby;//复选框

    //private  String [] hobby;
    @JsonIgnore
    private int  version;//忽略该字段

    private   String gender;




}
